function [output_seq, PSSCH_FFT_Template] = Function_Create_PSSCH_Subframe (NSLsymb, NFFT, cpLen0, cpLenR, NSLRB, NSLID, PSSCH_RB_Size, PSSCH_RB_Start)
	NRBsc = 12; 
    PSCCH_DMRS_symbloc_perSubframe   = [2 5 8 11]';               % PSCCH DMRS Symbol locations per subframe for PSCCH
    PSCCH_symbloc_perSubframe        = [0 1 3 4 6 7 9 10 12 13]'; % PSCCH Symbol locations per subframe for PSCCH
    PSSCH_DMRS_symbloc_perSubframe   = [2 5 8 11]';               % PSSCH DMRS Symbol locations per subframe for PSCCH
    PSSCH_symbloc_perSubframe        = [0 1 3 4 6 7 9 10 12 13]'; % PSSCH Symbol locations per subframe for PSCCH
    
	
    Hopping = 'Off';            % Hopping method ('Off', 'Group', 'Sequence')
	% PSCCH DMRS sequences computation (NCS SELECTION NOT IMPLEMENTED YET!!! Set it arbitrarily to 0)
	ncs_val = 0;
    N_PRB = 2;
    
    PSSCH_Modulation_Order = 2;

    subixs_PSCCH = (PSSCH_RB_Start+0:1:PSSCH_RB_Start+1)';
    subixs_PSCCH = Function_prbs_To_subs(subixs_PSCCH, NRBsc);
    subixs_PSSCH = (PSSCH_RB_Start+3:1:PSSCH_RB_Start+PSSCH_RB_Size+2)';
    subixs_PSSCH = Function_prbs_To_subs(subixs_PSSCH, NRBsc);
	% define output
	tx_output_grid = complex(zeros(NSLRB*NRBsc,2*NSLsymb));
            

	% (1) Control channel
    load PSCCH_Output.mat
	PSCCH_Grid = Function_Phy_Resources_Mapper(2*NSLsymb, NSLRB*NRBsc, PSCCH_symbloc_perSubframe, subixs_PSCCH, pscch_out);
	
    Mode = 'pscch_V2X';                 % Generate PSBCH samples
    [PSCCH_DMRS_Seq, DRSSymInfo] = Function_Generate_DMRS_Seq(N_PRB,  NSLID, ncs_val, Mode, Hopping);
    PSCCH_DMRS_Grid = Function_Phy_Resources_Mapper(2*NSLsymb, NSLRB*NRBsc, PSCCH_DMRS_symbloc_perSubframe, subixs_PSCCH, PSCCH_DMRS_Seq);

    tx_output_grid = PSCCH_Grid + PSCCH_DMRS_Grid;
              
	% (2) Data channel
    Data_Length = PSSCH_RB_Size * NRBsc * length(PSSCH_symbloc_perSubframe) * PSSCH_Modulation_Order;
    NoOfSubcarriers = PSSCH_RB_Size * NRBsc;
    Temp_Tx_Data = randi([0,1], Data_Length, 1);
    
	if PSSCH_Modulation_Order == 2, Temp_Tx_Symbol = Function_Phy_Modulate(Temp_Tx_Data, 'QPSK');
	elseif  PSSCH_Modulation_Order == 4, Temp_Tx_Symbol = Function_Phy_Modulate(Temp_Tx_Data, '16QAM'); end
    [slsch_out] = Function_Phy_Transform_Precoding(Temp_Tx_Symbol, NoOfSubcarriers );

	PSSCH_Grid = Function_Phy_Resources_Mapper(2*NSLsymb, NSLRB*NRBsc, PSSCH_symbloc_perSubframe, subixs_PSSCH, slsch_out);

    % Calculate data dmrs
    Mode = 'pssch_V2X'; 
    N_PRB = PSSCH_RB_Size;
    [PSSCH_DMRS_Seq, DRSSymInfo] = Function_Generate_DMRS_Seq(N_PRB,  nXIDs, ncs_val, Mode, Hopping);
    
	% Map data dmrs to grid
	PSSCH_DMRS_Grid = Function_Phy_Resources_Mapper(2*NSLsymb, NSLRB*NRBsc, PSSCH_DMRS_symbloc_perSubframe, subixs_PSSCH, PSSCH_DMRS_Seq);
            
	% Get total grid: Control (if exists) + Data
	tx_output_grid = tx_output_grid + PSSCH_Grid + PSSCH_DMRS_Grid;
	% Time-domain transformation
    output_seq = Function_Phy_OFDM_Modulate_per_Subframe(NSLsymb, NFFT, cpLen0, cpLenR, NRBsc, NSLRB, tx_output_grid);
    
    PSCCH_Length = length(subixs_PSCCH);
    PSSCH_Length = length(subixs_PSSCH);
    
    PSSCH_FFT_Template = zeros(NFFT,1);
    
    for n = 1:PSCCH_Length
       PSSCH_FFT_Template((NFFT-NSLRB*NRBsc)/2+1+subixs_PSCCH(n)) = 1;
    end
    for n = 1:PSSCH_Length
       PSSCH_FFT_Template((NFFT-NSLRB*NRBsc)/2+1+subixs_PSSCH(n)) = 1;
    end
    PSSCH_FFT_Template = ifftshift(PSSCH_FFT_Template);

end %CreateSubframe